import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.company.quick56.web.login.LoginAction;


public class SpringTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {
		ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
//		UserService userService = (UserService) ctx.getBean("userService");
//		User user = new User("haha");
//		user.setPassword("magicboy");
//		
//		userService.save(user);
//		
//		List<User> users = userService.findAll();
//		
//		for(User theUser : users){
//			System.out.println(theUser.getUsername());
//		}
		
//		UniversalService universalService = (UniversalService) ctx.getBean("universalService");
//		User user = new User("sfsdf");
//		user.setPassword("magicboy");
//		
//		universalService.save(user);
//		
//		List<User> users = universalService.getAll(User.class);
//		
//		for(User theUser : users){
//			System.out.println(theUser.getUsername());
//		}
		
		LoginAction login = (LoginAction) ctx.getBean("loginAction");
		login.setUsername("lvshuyan");
		login.setPassword("");
		
		System.out.println(login.execute());

	}

}
